package com.work.simpleoa.gencode.model;

import com.work.simpleoa.emun.TemplateEmun;
import com.work.simpleoa.gencode.AbstractAutoGenChain;
import com.work.simpleoa.gencode.IAutoGenChain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: liuwangzhen
 * @date: 2018-12-17 下午3:33
 */
@Component
public class ServiceModelChain extends AbstractAutoGenChain {

    private static final Logger log = LoggerFactory.getLogger(ServiceModelChain.class);

    @Autowired
    @Qualifier("serviceImplModelChain")
    IAutoGenChain ServiceImplModelChain;

    public ServiceModelChain(){
        super(TemplateEmun.SERVICE_TEMPLATE);
    }



    @Override
    public Boolean isCurrentType(TemplateEmun templateEmun) {
        if (myEmun.getName().equals(templateEmun.getName())) {
            return Boolean.TRUE;
        } else {
            return Boolean.FALSE;
        }
    }


    @Override
    public Boolean nextGenChain(TemplateEmun templateEmun){
        return ServiceImplModelChain.distinctTypeAndGen(templateEmun);
    }

    @Override
    public Logger getLogger() {
        return log;
    }

}
